Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
Sigo recibiendo un mensaje de error "Error de tipo: indefinido no es un objeto"

He estado intentando crear un script para permitir que los usuarios instalen un perfil de configuración en sus dispositivos iOS o iPadOS, y mi código es:

 function downloadProfile(profileName, configurationProfile) { var element = document.createElement("a"); element.setAttribute("href", "data:application/x-apple-aspen-config," + encodeURIComponent(configurationProfile)); element.setAttribute("download", profileName + ".mobileconfig"); element.body.appendChild(element); element.click(); element.body.removeChild(); }

El problema es que sigo recibiendo un mensaje de error que dice Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'element.body.appendChild') . ¿Alguien sabe una solución? Por supuesto, este no es el código completo, es solo la parte con la que necesito ayuda.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El elemento que crea no tiene un cuerpo de propiedad. Supongo que desea agregar el nuevo elemento al documento, así en su lugar:

 document.body.appendChild(element);

Busque un ejemplo: https://www.w3schools.com/jsref/met_document_createelement.asp

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!